package com.io.classesforutility;

import java.io.Serializable;

public class Person implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3956679559889685189L;
	private static final String DEFAULT_NAME = "Nikolay";
	private static final int DEFAULT_AGE = 20;
	private static final String DEFAULT_COURSE = "JAVA";

	private String name;
	private int age;
	private String course;

	public Person() {
		this.name = DEFAULT_NAME;
		this.age = DEFAULT_AGE;
		this.course = DEFAULT_COURSE;
	}

	Person(String name, int age, String course) {
		this();
		this.setName(name);
		this.setAge(age);
		this.setCourse(course);
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		if (name != null && (!name.equals(""))){
			this.name = name;
		}
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		if (age > 0){
			this.age = age;
		}
	}

	public String getCourse() {
		return course;
	}

	public void setCourse(String course) {
		if (name != null && (!name.equals(""))){
			this.course = course;
		}
	}
}
